Preserving document design using font synthesis

ABSTRACT

Automatic font synthesis for modifying a local font to have an appearance that is visually similar to a source font is described. A font modification system receives an electronic document including the source font together with an indication of a font descriptor for the source font. The font descriptor includes information describing various font attributes for the source font, which define a visual appearance of the source font. Using the source font descriptor, the font modification system identifies a local font that is visually similar in appearance to the source font by comparing local font descriptors to the source font descriptor. A visually similar font is then synthesized by modifying glyph outlines of the local font to achieve the visual appearance defined by the source font descriptor. The synthesized font is then used to replace the source font and output in the electronic document at the computing device.

BACKGROUND

In many forms of digital content, a visual appearance of text is often asignificant aspect involved in conveying the intended meaning of a givendesign. For instance, different fonts may be used to render the sametext in different appearances, which may be carefully chosen toestablish a mood, convey a desired aesthetic, stimulate an emotion,communicate a meaning, generate interest, provide a unifying theme,attract attention, and so forth. Unfortunately, problems arise whendigital content is communicated among different computing devices. Torender text using the visual appearance of a desired font, a computingdevice references the desired font to access instructions for renderingindividual glyphs of the font. However, not all fonts are present on allcomputing devices. A font that is available on a source computing devicemay not be available on a destination computing device due to any of anumber of possible reasons.

In some situations, a desired font can be embedded in a file having agiven design. In these situations, the font is automaticallycommunicated along with the design. But such embedding is not alwaysfeasible. First, technical issues may preclude embedding. For instance,there may not be sufficient bandwidth to include the font in the filehaving the design. Also, there is no guarantee that a destinationcomputing device is capable of rendering text with a particular embeddedfont. Second, legal issues may preclude embedding a font into a filehaving a design. Generally, a person purchases a non-transferable right(e.g., a license) to use a font on a single computing device or a setnumber of computing devices. A user may therefore not have a legal rightto embed a font into a design being transmitted to a destinationcomputing device, or the destination computing device may lack a licenseto use the font legally.

For these reasons, embedding a font into a design is often infeasible.Consequently, a destination computing device may receive a design thatidentifies a font without embedding the identified font. The destinationcomputing device is then responsible for determining a replacement fontfor the missing font. Conventional approaches to determining replacementfonts in an ad-hoc manner and rely on heuristic rules that only work fora limited set of fonts. Because not all fonts share common typographicproperties, replacing a font with a substitute font often results indistributing an original design layout for an electronic document. Someconventional approaches to replacing a font include utilizing multiplemaster fonts. These conventional approaches generate a replacement fontby interpolating between two or more master fonts. However, theresulting interpolated font differs from respective visual appearancesof the multiple master fonts and result in replacement fonts that arevisually dissimilar to a source font being replaced.

Thus, conventional approaches to font replacement fail to maintain thevisual appearance of text as desired by the creative professional thatgenerated the design. Consequently, the overall intended meaning andeffect of the design is compromised.

SUMMARY

Automatic font synthesis for modifying a local font to have a visuallysimilar appearance to a source font in an electronic document isdescribed. A font modification system receives the electronic documentincluding the source font from a different computing device. In responseto determining that the computing device is unable to render orotherwise use the source font, the font modification system extracts afont descriptor for the source font from the electronic document. Thefont descriptor includes information describing various font attributesfor the source font, which refer to properties that are useable todefine a visual appearance of the source font. Using the font descriptorfor the source font, the font modification system identifies a localfont that is visually similar in appearance to the source font and isavailable for use by the computing device.

To do so, the font modification module is configured to generate localfont descriptors for each local font available for use by the computingdevice. The local font descriptors are then compared with the fontdescriptor for the source font and the local font having the closestvisual similarity is selected for synthetization. The local font is thensynthesized by modifying an outline of at least one glyph of the localfont, based on the font attribute values specified in the source fontdescriptor, such that the modified glyph outline is visually similar inappearance to a corresponding glyph of the source font. The synthesizedfont is then used to replace the source font in the electronic documentsuch that the electronic document can be output for display at thecomputing device in a manner that emulates the original design layoutfor the electronic document.

This Summary introduces a selection of concepts in a simplified formthat are further described below in the Detailed Description. As such,this Summary is not intended to identify essential features of theclaimed subject matter, nor is it intended to be used as an aid indetermining the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

The detailed description is described with reference to the accompanyingfigures.

FIG. 1 is an illustration of an environment in an example implementationthat is operable to employ the font synthesis techniques describedherein.

FIG. 2 illustrates an example implementation in which the fontmodification system of FIG. 1 generates an electronic document thatincludes synthesized font using techniques described herein.

FIG. 3 illustrates an example implementation in which the fontmodification system of FIG. 1 generates a font descriptor for a font ina machine learning environment.

FIG. 4 illustrates an example implementation in which the fontmodification system of FIG. 1 generates different font descriptors fordifferent fonts of an electronic document.

FIG. 5 illustrates an example implementation in which the fontmodification system of FIG. 1 identifies at least one similar font basedon a font descriptor.

FIG. 6 illustrates an example of a glyph outline for a glyph of a font.

FIGS. 7A-7C illustrate example implementations in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'shorizontal weight.

FIG. 8 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'shorizontal weight.

FIG. 9 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'svertical weight.

FIG. 10 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by maintaining the font'sorigin and modifying the font's vertical weight.

FIG. 11 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'svertical weight.

FIG. 12 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'soverall weight.

FIG. 13 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying glyph width.

FIG. 14 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying glyph width.

FIG. 15 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'sCapHeight.

FIG. 16 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'sCapHeight.

FIG. 17 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font's)xHeight.

FIG. 18 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font's)xHeight.

FIG. 19 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'sascent.

FIG. 20 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'sdescent.

FIG. 21 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by generating compositeglyphs via glyph weight modification.

FIG. 22 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'sslant angle.

FIG. 23 illustrates an example implementation in which the fontmodification system of FIG. 1 synthesizes font by modifying the font'scontrast.

FIG. 24 illustrates an example implementation of an interface thatincludes a selectable font attributes that can be used to controlsynthesis of a target font by the font modification system of FIG. 1.

FIG. 25 is a flow diagram depicting a procedure in an exampleimplementation for rendering an electronic document with synthesizedfont using the techniques described herein.

FIG. 26 is a flow diagram depicting a procedure in an exampleimplementation for generating synthesized font using the techniquesdescribed herein.

FIG. 27 illustrates an example system including various components of anexample device that can be implemented as a computing device asdescribed and/or utilized with reference to FIGS. 1-26 to implement thetechniques described herein.

DETAILED DESCRIPTION

Overview

Due to technical and legal difficulties electronic document creators areoften precluded from embedding a source font into the electronicdocument at source computing device where the electronic document isgenerated. Upon reception of such a document at a different computingdevice, the different computing device is forced to determine areplacement for the source font. Asking a user to select a local font isinconvenient and time consuming for the user, and does not ensure thatthe visual appearance of the source font will be maintained. Although auser-independent heuristics-based approach to font replacement can beemployed, such a heuristics-based approach is ad-hoc and is thereforeboth unreliable and limited in applicability. Consequently, conventionalapproaches to font replacement do not provide any reasonable expectationthat the aesthetic intentions or communication goals of a given designcan be maintained when the source font is not available for use by acomputing device presenting the electronic document.

Systems and techniques for preserving document design using fontsynthesis are described herein. A computing device implementing a fontmodification system receives an electronic document that includes asource font which is unavailable for use by the computing device. Avisual appearance of the source font is defined based on a fontdescriptor, which includes information describing font attributes forthe source font and is embedded in the electronic document. The fontmodification system includes a local font descriptor module that isconfigured to generate local font descriptors for each local font thatis available to the computing device implementing the font modificationsystem. Using the font descriptor of the source font and the local fontdescriptors generated by the local font descriptor module, the fontmodification system implements a font similarity module that isconfigured to recognize similarity between visual appearances of thesource font and different local fonts. In some implementations, fontsimilarity is identified using a machine learning system tuned torecognize similarity between the visual appearances of two differentfonts.

Although a visually similar local font can be used to replace the sourcefont, simply replacing the source font with the visually similar localfont does not provide any assurance that an original design layout ofthe electronic document will be preserved. To address this shortcomingof conventional approaches, the font modification system 104 isconfigured to modify an outline of one or more glyphs of the visuallysimilar local font to emulate a visual appearance of the source font.Although conventional approaches for glyph modifications exist, suchconventional approaches perform glyph modification by scaling glyphoutlines to modify respective width or height properties of the glyph.This conventional scaling approach results in distortion of glyph strokeweights, and thus fail to achieve a visually similar appearance to asource font being replaced.

Other conventional systems for modifying a visual appearance of textrequire at least two master fonts which are original fonts. Thesesystems interpolate between the at least two master fonts to generate anew font. A visual appearance of the new font differs from a visualappearance of the at least two master fonts based on the interpolation.These systems require generation of a new font file to change the visualappearance of the text which may not be compatible across applications.Conventional systems which allow a single font file to store acontinuous range of design variants may also be used to change a visualappearance of text. However, even these systems are limited to changingvisual appearance using modification values of the single font filewhich may be limited in terms of the functionality which they canprovide. For these systems, the modification values may only allowmodification of a single visual feature of the text.

To address these shortcomings of conventional approaches, the fontmodification system is configured to generate synthesized font bymodifying an outline of glyphs for a local font in a manner thatachieves font attributes similar to those of the source font. To do so,the font modification system is configured to represent individualglyphs using as segments such that each of the segments has a startpoint, an endpoint, and a direction based on the start point and theendpoint. For example, the system can represent the outline of the glyphas Bezier paths.

Given the outlines of font glyphs and respective font descriptors of thesource font and local font to be modified in generating synthesizedfont, the font modification system computes a design vector array thatdescribes differences between similar font attributes of the source fontand local font. In some implementations, the font modification system isconfigured to compute a design vector array on a per-line basis for eachline of source font to be replaced in the electronic document. Theresulting design vector array is then used to generate synthesized fontby modifying respective glyph outlines of the local font in a mannerthat results in the synthesized font having a similar visual appearanceto the source font.

In the following discussion, an example environment is first describedthat may employ the techniques described herein. Example procedures arealso described which may be performed in the example environment as wellas other environments. Consequently, performance of the exampleprocedures is not limited to the example environment and the exampleenvironment is not limited to performance of the example procedures.

Terminology Examples

Example descriptions or explanations of certain terms as used herein areset forth below. Each term is applicable to one or more, but notnecessarily all, implementations described herein. Some terms arefurther elucidated using one or more examples.

An “electronic document” refers to a visible creation such as a designor an electronic file that embodies the visible creation. Examples ofelectronic documents include marketing materials such as digitalpamphlets, book illustrations, presentations such as slide decks, webpages, word processing products, content output via applications,combinations thereof, and so forth. An electronic document can includetext rendered in accordance with a given font.

A “font” refers to a digital representation (e.g., a file or some code)of a typeface or a specific style thereof. Examples of typefaces includeTimes New Roman, Helvetica, Calibri, Baskerville Old Face, BritannicBold, Neuropol, Vladimir Script, and Courier New. Historically, eachtypeface was one particular point size because letters were made fromindividual physical stamps. In modern digital environments, however, afont can include or be usable to produce characters at many differentpoint sizes. A font may also be considered to include basic stylevariations or effects, such as italics or bold. A font providesinstructions for digitally rendering text in accordance with theassociated typeface.

A “local font” refers to a font that is present at, and available forrendering text on, a given computing device. The adjective “available”in the context of a “font” refers to when a computing device is legallyand technically capable of using the font to render text. Conversely, an“unavailable font” refers to a font that is not present at a computingdevice or a font that the computing device is unable to use to rendertext due to legal constraints or technical abilities.

A “similar font” refers to a font having an appearance that is visuallycomparable to another font. Font similarity can be based on relativesimilarity, such as one or more fonts that are the most similar (e.g.,have a smallest distance between two font descriptors) from among a setof available fonts. Alternatively, font similarity can be based onobjective similarity, such as a maximum threshold distance between twofont descriptors that respectively correspond to two different fonts. A“visually-similar font” refers to a font that is similar based onvisible characteristics or attributes. In a character-by-character fontreplacement scenario, a similar font includes a similar individualcharacter, and a visually-similar font includes a visually-similarindividual character.

A “visual appearance” refers to visible characteristics or attributes oftext rendered in accordance with a given font. The visual appearance canbe separate from the instructions used to render a font or independentof font metadata, such as name, family, and so forth. Aspects of thevisual appearance of a font are at least partially detectable by thehuman eye at some resolution. The visual appearance of a font can beembodied in an image of text rendered in accordance with the font.Related to the visual appearance of a font is a “distance” aspectbetween two or more font descriptors that indicates how similar two fontdescriptors are to one another, and thus how similar the twocorresponding fonts are to each other. The distance between two fontdescriptors is determined by a destination computing device thatreceives a document having a font descriptor. A distance between twofont descriptors is realized as, for example, a pairwise differencebetween two feature vectors.

An “image” refers to an output of a font. The output can be realized assome bitmapped product of the font having text that is rendered at someresolution. The image can include one or more glyphs rendered inaccordance with the instructions of the font. For example, multipleglyphs that include a set of uppercase letters or a set of lowercaseletters can be rendered. An image can also include a single glyphrendered for an individual character of a font.

A “glyph” refers to a physical shape or form that is perceivable by thehuman eye and connotes a corresponding textual character. A computingdevice renders a glyph on a display screen or on a physical hard copy. Aglyph is specific to how a particular font renders a given character,but a character transcends multiple fonts. Examples of charactersinclude a letter of an alphabet, a symbol, an ideograph, punctuation, anemoji, a logogram, or any other human-readable or interpretable formthat can be represented as text using a computing device. Thus, fontscan include those directed to the Chinese, Japanese, or Koreancharacter-based languages, as well as directed to letter-basedlanguages.

“Machine learning” refers to technology in a digital environment that iscapable of producing an output based on an input using knowledge orintelligence garnered from training. In a supervised learningimplementation, training samples are input to a machine learning systemduring training so that the machine can learn about at least onerelationship incorporated into the training samples, such as fontsimilarity. After the training, a machine learning apparatus can producean output based on an input using the learned relationship. Examples ofimplementation techniques for machine learning for unsupervised orsupervised learning may include association rule learning, supportvector machines (SVMs), Bayesian networks, regression, artificial neuralnetworks, convolutional neural networks, deep learning, and combinationsthereof. As used herein, a “machine learning system” can produce a modelthat incorporates a learned relationship.

A “font visual similarity model” refers to a model produced with machinelearning so as to characterize fonts such that the fonts can be comparedto one another in terms of at least visual similarity. A font visualsimilarity model can be implemented as, for example, aprocessor-executable module, a convolutional artificial neural network,or a combination thereof. If an image including multiple glyphs that arerendered by a given font is input to a font visual similarity model, themodel can output a font descriptor having multiple font features thatcorrespond to visual appearance aspects of the given font.

A “font descriptor” refers to a product of a font visual similaritymodel that characterizes a visual appearance of a font using fontfeatures. A font descriptor corresponding to one font can be compared toa font descriptor corresponding to another font to compute a semanticdistance between the two fonts, with the semantic distance indicative ofa visual similarity between the two fonts. “Font attributes” refer todifferent dimensions for characterizing the visual appearance of a font.Font attributes result from application of machine learning technologyto the font image. A “per-character font descriptor” refers to a fontdescriptor that is directed to an individual character of a font.

Example Environment

FIG. 1 is an illustration of a digital medium environment 100 in anexample implementation that is operable to employ the techniquesdescribed herein. The illustrated environment 100 includes a computingdevice 102, which may be implemented in various configurations. Thecomputing device 102, for instance, may be configured as a desktopcomputer, a laptop computer, a mobile device (e.g., assuming a handheldconfiguration such as a tablet or mobile phone), and so forth. Thus, thecomputing device 102 may range from a full resource device withsubstantial memory and processor resources (e.g., personal computers,game consoles) to a low-resource device with limited memory and/orprocessing resources (e.g., mobile devices). Additionally, although asingle computing device 102 is shown, the computing device 102 may berepresentative of a plurality of different devices, such as multipleservers to perform operations “over the cloud” as described with respectto FIG. 27.

The computing device 102 is illustrated as including font modificationsystem 104. The font modification system 104 represents functionality ofthe computing device 102 to receive an electronic document 106containing source font 108. The source font 108 is formatted to have avisual appearance 110 that is defined by a font descriptor 112. Asdescribed in further detail below with respect to FIG. 3, the fontdescriptor 112 includes information describing various font attributesfor visual appearance 110 of the source font 108. In the illustratedexample, computing device 102 receives the electronic document from adifferent computing device 114.

In accordance with one or more implementations, the source font 108 maybe a font that is authorized for use on the different computing device114 and not authorized for use on the computing device 102. In order tooutput a display of the electronic document 106 in a manner thatmaintains visual similarity to an original design layout, the computingdevice 102 is configured to leverage the font modification system 104 togenerate a synthesized font 116. The synthesized font 116 can then beused to replace the source font 108 and output the electronic document106 at the computing device 102 in a manner that preserves an originaldesign layout of the electronic document 106 without requiring thecomputing device 102 to obtain a license or other authorization to usethe source font 108.

To generate synthesized font 116, the font modification system 104implements a local font descriptor module 118, a font similarity module120, a font synthesis module 122, and a rendering module 124. The localfont descriptor module 118, the font similarity module 120, the fontsynthesis module 122, and the rendering module 124 are each implementedat least partially in hardware of the computing device 102 (e.g.,through use of a processing system and computer-readable storage media),as described in further detail below with respect to FIG. 27.

The local font descriptor module 118 is configured to identify at leastone local font that is available for use by the computing device 102 andhas a visually similar appearance to the source font 108. To identifylocal fonts that are visually similar to the source font 108, the localfont descriptor module 118 is configured to compute font descriptors foreach local font available for use by the computing device 102, asdescribed in further detail below with respect to FIG. 4.

After computing the font descriptors for available local fonts, the fontsimilarity module 120 compares the font descriptor 112 of the sourcefont 108 with font descriptors for the local fonts that were computed bythe local font descriptor module 118. From this comparison, the localfont similarity module 120 outputs a sorted list of visually similarfonts that are available to the computing device 102 and differ from thesource font 108 based on one or more font attribute values.

The sorted list of visually similar fonts is then useable by the fontsynthesis module 122 to select a local font available to the computingdevice 102 that has a visually similar appearance to the source font 108as used in the electronic document 106 and generate the synthesized font116. To generate the synthesized font 116, the font synthesis module 122modifies an outline of one or more glyphs of the local font, rather thanmodifying an original font-program of the local font. In this manner,the font synthesis module 122 modifies a visual appearance of one ormore font glyphs in a manner that makes the synthesized font 116 appeartypographically correct when compared to the source font 108 as includedin the electronic document 106. Modification of glyph outlines isdescribed and illustrated in further detail below with respect to FIGS.6A-22.

The modified glyph outlines of the local font are then passed to therendering module 124, which is configured to output a display of thesynthesized font 116. The rendering module 124 is representative offunctionality to output the synthesized font 116 in a variety ofmanners, such as in a preview display of a user interface for the fontmodification system 104, in an instance of the electronic document 106where the synthesized font replaces the source font 108, combinationsthereof, and so forth.

The synthesized font 116, a modified instance of the electronic document106 that includes the synthesized font 116, font descriptors computed bythe local font descriptor module 118, lists of visually similar fontsgenerated by the font similarity module 120, and other informationgenerated by the font modification system 103 may be stored in storageof the computing device 102, as described in further detail below withrespect to FIG. 27. Alternatively or additionally, information generatedby the font modification system 104 may be provided to a remote storagelocation for subsequent retrieval and/or access by the computing device102 or different computing devices. For instance, the font modificationsystem 104 may communicate information to the different computing device114 or another remote storage location, via network 126.

Having considered an example digital medium environment, consider now adiscussion of an example system useable to generate synthesized font inaccordance with aspects of the disclosure herein.

FIG. 2 illustrates an example system 200 useable to generate anelectronic document 106 including synthesized font 116 generated basedon a source font 108 in accordance with the techniques described herein.In the illustrated example, system 200 includes modules of the fontmodification system 104 as described with respect to FIG. 1, such as thelocal font descriptor module 118, the font similarity module 120, thefont synthesis module 122, and the rendering module 124. System 200 maybe implemented on any suitable device or combination of devices. In oneexample, system 200 is implemented on one computing device (e.g.,computing device 102 of FIG. 1). In another example, system 200 isimplemented on more than one computing device, as described in furtherdetail below with respect to FIG. 27.

In the example system 200, the font modification system 104 receives anelectronic document 106 that includes at least one source font 108having a visual appearance defined by font descriptor 112. As describedherein, the electronic document 106 is received by the font modificationsystem 104 with a font file for the source font 108 embedded in theelectronic document 106. The font descriptor 112 is representative ofinformation embedded in metadata of the electronic document 106, andrefers to a vector of real numbers indicating a plurality (e.g.,hundreds) of different dimensions, where each dimension represents afont attribute value.

Various font attributes represented by the font descriptor may includeinformation that is useable to define a font family for the font,relationship of fonts within a font family to one another, andcategorical attributes that generally describe a font's visualappearance, such as font attributes as described in further detail belowwith respect to FIG. 3. Although the font descriptor 112 includesinformation that is useable to define a visual appearance of the sourcefont 108, the font descriptor is not reversible by the font modificationsystem 104 to output the source font 108 itself.

Upon receiving the electronic document 106, the font modification system104 communicates the font descriptor 112 for the source font 108 to thelocal font descriptor module 118. The local font descriptor module 118is configured to identify at least one local font 202, which isrepresentative of a font that is available for use by the computingdevice implementing the font modification system 104. For each localfont 202, the local font descriptor module 118 computes a local fontdescriptor 204, as described in further detail below with respect toFIG. 4. Each local font descriptor 204 refers to a vector of realnumbers indicating a plurality (e.g., hundreds) of different dimensions,where each dimension represents a font attribute value. Various fontattributes represented by an individual local font descriptor 204 mayinclude information that is useable to define a font family for thefont, relationship of fonts within a font family to one another, andcategorical attributes that generally describe a font's visualappearance, such as font attributes described in further detail belowwith respect to FIG. 3.

In some implementations, a font descriptor may be extracted as neuronresponses from a convolutional neural network that receives a renderedtext image for a given font as input, such as a font visual similaritymodel as described in further detail below with respect to FIG. 3.Example font descriptor vectors for three different fonts areillustrated below in Table 1, which includes only the first threeentries for each font descriptor for brevity, rather than the hundredsof dimensions otherwise represented by a single font descriptor.

TABLE 1 Font Font Descriptor A [0.23, 0.12, −0.96, . . .] B [0.10, 0.06,−0.99, . . .] C [0.92, 0.35, 0.17, . . .]

In order to measure the similarity between different fonts, the fontsimilarity module 120 is configured to compute the inner product of thevector dimensions for two different fonts. For instance, using examplefont descriptors for fonts A and B as indicated in Table 1, the fontsimilarity module is configured to determine a similarity score S(A,B)according to Equation 1.S(A,B)=(0.23)×(0.10)+(0.12)×(0.06)+(−0.96)×(−0.99)+ . . . =0.98  (Eq. 1)

In a similar manner, the font similarity module 120 is configured tocompute a similarity score for fonts A and C, S(A,C), according toEquation 2.S(A,C)=(0.23)×(0.92)+(0.12)×(0.35)+(−0.96)×(0.17)+ . . . =0.09  (Eq. 2)

Using the example fonts of Table 1 and the font similarity computationsof Equations 1 and 2, font A may be representative of source font 108,where fonts B and C correspond to different local fonts 202 that areavailable for use by a computing device implementing the fontmodification system 104.

The local font descriptors 204 are then communicated along with the fontdescriptor 112 for the source font 208 to the font similarity module120. The font similarity module 120 then generates a list of rankedlocal font descriptors 206, which describes a visual similarity betweenthe source font 108 and each of the local fonts 202, as described by therespective font descriptor 112 and local font descriptors 204.

Using the example similarity scores S(A,B)=0.98 and S(A,C)=0.09,computed using the information of Table 1 above, are useable by the fontsimilarity module 120 to output the list of ranked local fontdescriptors 206. Because visual similarity scores computed by the fontsimilarity module 120 are normalized on a scale of 0 to 1, with zeroindicating no visual similarity and one indicating an identical visualappearance, the scores computed in the example Equations 1 and 2indicate that font B has a visual appearance that is more similar tofont A than a visual appearance of font C to font A. Using this example,a semantic distance between the visual appearances of two fonts issmaller when the inner product of the vector dimensions for twodifferent fonts, as indicated by their respective font descriptors, iscloser to one.

In accordance with one or more implementations, the font similaritymodule 120 is configured to generate the list of ranked local fontdescriptors 206 using a font visual similarity model, as described infurther detail below with respect to FIG. 3. The ranked local fontdescriptors 206 are then communicated to the font synthesis module 122.

The font synthesis module 122 is configured to select a local font 202that is visually similar to the source font 108 based on the rankedlocal font descriptors 206 and modify the selected local font togenerate synthesized font 208. To do so, the font synthesis module 122modifies an outline of one or more glyphs of the selected local font byadjusting a position of one or more points of the glyph that connectlines or segments defining the glyph's outline in a manner thatmaintains a typographically correct appearance of the source font 108 asincluded in the electronic document 106. Thus, a particular manner inwhich the font synthesis module 122 modifies the selected local font togenerate the synthesized font 208 varies based on specific fontattributes for each of the selected local font and source font 108, asindicated by their respective font descriptors. Various glyphmodifications useable by the font synthesis module 122 to generate thesynthesized font 208 are described in further detail below with respectto FIGS. 6A-22.

Generally, the operations performed by the font synthesis module 122 ingenerating the synthesized font 208 are performed according to Algorithm1:

 1. Receive input indicating the font descriptor 112 and the local fontdescriptor 204 for the local font 202 to be modified in order to outputsynthesized font 208.  2. Fetch design axes values using to aligntypographic attributes of the local font 202 with the source font 108(steps 3-10):  3. DV[0] =GetDesignAxisValueToMakeSimilarAttribute(sFD.stemV, F.stemV); // forStemV  4. DV[1] = GetDesignAxisValueToMakeSimilarAttribute (sFD.stemH,F.stemH); // For StemH  5. DV[2] =GetDesignAxisValueToMakeSimilarAttribute (sFD.xHeight, F.xHeight); //For xHeight  6. DV[3] = GetDesignAxisValueToMakeSimilarAttribute(sFD.CapHeight, F.CapHeight); // For CapHeight  7. DV[4] =GetDesignAxisValueToMakeSimilarAttribute (sFD.Ascent, F.Ascent); // ForAscender height  8. DV[5] = GetDesignAxisValueToMakeSimilarAttribute(sFD.Descent, F.Descent); // For Descender depth  9. DV[6] =GetDesignAxisValueToMakeSimilarAttribute (sFD.ItalicAngle,F.ItalicAngle); // For Italic angle. 10. DV[7] = Compute design vectorfor width. 11. Output design vector (“DV”) array.

In order to compute a width design vector, because each glyph of a fontmay have different width attributes, different design vector values maybe required for every glyph. Consequently, modifying each glyph toachieve a same width in order for text to fit in a designated layoutwill not preserve the original design layout for an electronic document.Accordingly the font synthesis module 122 is configured to compute awidth design vector for each text line of the source font 108 asrendered in the electronic document 108. To do so, the font synthesismodule 122 computes, for each text line of the source font 108, thetotal width of the text line (sW) using a width from a widths array ofthe source font 108's font descriptor 112 (sFD), where sWi correspondsto the width of the source font 108 in Equation 3:sW=Σ _(i=0) ^(n) sWi  (Eq. 3)

The font synthesis module 122 additionally computes, for each line oftext of the source font 108, the total text line width as a target width(tW) using width values from the respective font descriptors accordingto Equation 4, where twi corresponds to the width of an ith glyph forthe synthesized font 208:tW=Σ _(i=0) ^(n) twi  (Eq. 4)

The font synthesis module then obtains the design vector for each textline: DV[7]=GetDesignAxisValueToMakeSimilarAttribute (sW, tW) for use inAlgorithm 1. Thus, DV[7] will be different for each line of text in theelectronic document 106 in order to preserve its original design layout.In this manner, the font synthesis module 122 is configured to outputthe design vector array computed according to Algorithm 1 for each lineof source font 108 to be replaced in the electronic document. Theresulting design vector array is used to generate the synthesized font208 by modifying respective glyph outlines of the local font 202, asdescribed in further detail below.

The synthesized font 208 is then output for display by the renderingmodule 124. In some implementations, the rendering module 124 isconfigured to output a preview display of the synthesized font 208 in auser interface of the font modification system 104, optionally togetherwith a display of the source font 108. The preview display of thesynthesized font 208 may be displayed on its own, independent of anyother font glyphs, or as part of the electronic document 106 torepresent an appearance of the electronic document 106 with thesynthesized font 208 replacing the source font 108. In someimplementations, a preview of the synthesized font 208 may be displayedby the rendering module 124 together with one or more user interfacecontrols that enable a user of the computing device implementing thefont modification system 104 to fine-tune various glyph modificationsused to generate the synthesized font 208. Alternatively oradditionally, the rendering module 124 is configured to automaticallyoutput an instance of the electronic document 106 that includes thesynthesized font 208 in place of the source font 108, such as aninstance of the electronic document 106 with the synthesized font 116displayed in place of the source font 108.

Having considered an example system, consider now example details ofgenerating an electronic document including synthesized font in place ofsource font in accordance with the techniques described herein.

FIG. 3 illustrates an example machine learning environment 300 in whicha machine learning system 302 generates a font visual similarity model304. The font visual similarity model 304 is representative offunctionality that can be implemented by the local font descriptormodule 118 to generate a local font descriptor 204 given a font image306, such as a font image for one of the local fonts 202 illustrated inFIG. 2. In the illustrated environment, a set of training font images308 are input to the machine learning system 302 and processed togenerate the font visual similarity model 304. The training font images308 include images of text rendered using different fonts. In someimplementations, the machine learning system 302 is implemented usingmultiple columns 310. Each of the columns 310 processes a rendered glyphas an instance of the text for a particular font. The columns 310include an anchor image column 310-1, a positive image column 310-2, anda negative image column 310-3.

The anchor image column 310-1 is provided with an anchor image includingat least one glyph rendered using a given font type. The positive imagecolumn 310-2 is provided with a positive image including at least oneglyph derived from the given font type. For example, the positive imageglyph may be the same glyph as the anchor glyph with a perturbation(e.g., a rotation) or a different glyph from the same given font type.The negative image column 310-3 is provided with a negative imageincluding at least one glyph rendered using a particular font type thatdiffers from the given font type. Different training font images 308 maybe input to the machine learning system 302 and iterated until themachine learning system 302 converges to generate the font visualsimilarity model 304.

Some machine learning systems operate with multiple layers. Artificialneural networks, for example, have multiple neuron-like nodes that areorganized into multiple layers. In example embodiments, the font visualsimilarity model 304 includes multiple nodes 314 that are coupled to oneanother via one or more connections 312. The nodes 314 are organizedinto multiple layers 316. Multiple layers 316-1, 316-2 . . . 316-(n−2),316-(n−1), 316-n are shown. The multiple layers 316 include an initialor input layer 316-1, a final or output layer 316-n, and multipleinternal layers 316-2 to 316-(n−1). Each node 314 corresponds to anactivity, and each connection 312 corresponds to a weight. During theiterations of the training to generate the font visual similarity model304, the weights or the activities are adjusted to achieve aconvergence.

In an example operation for computing a local font descriptor 112, afont image 306 for a local font 202 is input to the font visualsimilarity model 304. The font image 308 can be an image of one or moreglyphs that are rendered in accordance with a given font to represent avisual appearance of the given font. The font image 308 is provided tothe input layer 316-1. The corresponding local font descriptor 204 isextracted or output from the nodal values of an internal layer, such asthe layer 316-(n−2) or the layer 316-(n−1). The local font descriptor204 includes multiple font attributes 318 that are derived from thevisual appearance of the font image 306. The font attributes 318 canrespectively correspond to, for example, values of nodes 314 of thelayer 316 from which the local font descriptor 204 is extracted. By wayof example, two font images 306 can be input to the font visualsimilarity model 304. One font image 306 may include uppercase glyphsfor a font while the other font image 306 includes lowercase glyphs forthe font. The font attributes 318 for the uppercase and lowercase fontimages 306 are then concatenated to form the local font descriptor 204for the font. In this manner, the font attributes 318 are representativeof font properties that are useable to define a font's appearance.

As an example, font attributes 318 may include a “StemV” attribute,which describes a horizontal thickness of dominant vertical stems ofglyphs in the source font 108. Additionally or alternatively, the fontattributes 318 may include a “StemH” attribute, which describes avertical thickness of dominant horizontal stems of glyphs in the sourcefont 108. Alternatively or additionally, the font attributes 318 mayinclude an “xHeight” attribute, which describes a height of a lower caseLatin letter (e.g., “x”) measured from a baseline for the font.Alternatively or additionally, the font attributes 318 may include a“CapHeight” attribute, which describes a height of an upper case, orcapital, Latin letter (e.g., “X”) measured from a baseline for the font.Alternatively or additionally, the font attributes 318 may include an“Ascent” attribute, which describes a maximum height above a baselinefor the font to which glyphs of the font may extend. Alternatively oradditionally, the font attributes 318 may include a “Descent” attribute,which describes a maximum depth below a baseline for the font to whichglyphs of the font may extend. Alternatively or additionally, the fontattributes 318 may include an “ItalicAngle” attribute, which describesan angle expressed in degrees counterclockwise from a vertical axis ofdominant vertical strokes of the font. Alternatively or additionally,the font attributes 318 may include a “Widths” attribute, whichdescribes an array of widths of glyphs of the font as used in adocument, such as in the electronic document 106 illustrated in FIG. 1.

Thus, by leveraging the font visual similarity model 304, the local fontdescriptor module 118 is configured to generate a local font descriptor204 for a local font 202. In some implementations, the local fontdescriptor module 118 may be implemented by the different computingdevice 114 and used to generate the font descriptor 112 for the sourcefont 108 of the electronic document 106.

FIG. 4 illustrates an example implementation of the local fontdescriptor module 118 generating different font descriptors 112 fordifferent source fonts 108 included in the electronic document 106. Inthe illustrated example, the electronic document 106 includes threesource fonts 108-1, 108-2, and 108-3. Alternatively, more or fewer thanthree source fonts 108 can be included in the electronic document 106.Each source font 108 corresponds to a font image 306 that includesmultiple glyphs 402 that are rendered in accordance with thecorresponding source font 108. To create the font images 306, therendering module 124 may generate a bitmapped file representing a visualappearance of the corresponding source font 108.

Each font image 306 is input into the font visual similarity model 304,as implemented by the local font descriptor module 118. The font visualsimilarity model 304 then outputs respective font descriptors 112 basedon the visual appearance of the corresponding source font 108, asrealized by the respective font images 306. Thus, font descriptor 112-1corresponds to the source font 108-1, font descriptor 112-2 correspondsto the source font 108-2, and font descriptor 112-3 corresponds to thesource font 108-3. After generating the font descriptors 112, the localfont descriptor module 118 is configured to append the font descriptors112 to the electronic document 106 as being associated with therespective source fonts 108.

In some implementations, the local font descriptor module 118 generatesa font descriptor 112 for a source font 108 using the font visualsimilarity model 304 each time an electronic document 106 is finalizedor being prepared for transmission from the different computing device114 to the computing device 102. Alternatively or additionally, thelocal font descriptor module 118 determines a font descriptor 112 for asource font 108 by accessing a data structure, such as a fontdescriptor-to-font database. To produce such a font descriptor-to-fontdatabase, the local font descriptor module 118 establishes anassociation between a source font 108 and a corresponding fontdescriptor 112. The association can be created and stored on-demand aselectronic documents 106 are prepared for transmission or preemptively(e.g., pre-computed) prior to generation of an electronic document 106.

Although described herein with respect to generating the font descriptor112 for the source font 108 on the different computing device 114, thesame functionality may be leveraged by the local font descriptor module118 implemented on the computing device 102 to generate local fontdescriptors 204 for local fonts 202 that are available to the computingdevice 102. In this manner, the techniques described herein are useableto generate a font descriptor 112 for a source font 108 as well as alocal font descriptor 204 for a local font 202. Given a font descriptor112 and a plurality of local font descriptors 204, the font similaritymodule 120 is configured to generate a list of ranked local fontdescriptors 206, which orders the local font descriptors 204 based ontheir visual similarity to the source font 108, as indicated byrespective font attributes, such as font attributes 318, as illustratedin FIG. 3.

FIG. 5 illustrates an example implementation 500 in which the fontsimilarity module 120 of the font modification system 104 identifies oneor more local fonts 202 that are visually similar to the source font 108of the electronic document 106. The font similarity module 120 receivesat least one font descriptor 112, such as font descriptors 112-1, 112-2,and 112-3, representative of three different fonts included in theelectronic document 106.

To identify local fonts 202 that are visually similar to the source font108, the font similarity module 120 compares the font descriptors 112against local font descriptors 502, which are representative of localfont descriptors 204, as illustrated in FIG. 2. For each local fontdescriptor 204, respective distances between the font descriptor and thefont descriptor 112 for the source font 108 are calculated. Thedistances can comprise semantic distances indicative of how similar ornot similar the visual appearances of two fonts are as captured by therespective font descriptors 112. One or more of the smaller or smallestdistances are ascertained.

The font similarity module 120 then determines local font descriptors502 that are most visually similar to the font descriptors 112 based onthese ascertained distances. For instance, a font descriptor for a localfont 202 having the smallest distance from the font descriptor 112-1 canbe ascertained as local font descriptor 502-1, which corresponds to thelocal font 202 that is most visually similar to the source font 108identified by the font descriptor 112-1. In a similar manner, the localfont descriptor 502-2 corresponds to a local font 202 that is mostvisually similar to a source font 108 identified by the font descriptor112-2, and the local font descriptor 502-3 corresponds to a local font202 that is most visually similar to a source font 108 identified by thefont descriptor 112-3.

The ranked local font descriptors 206, as illustrated in FIG. 2, arethus representative of an ordered list of local font descriptors 204based on their calculated distances to the font descriptor 112. Theranked local font descriptors 206 may include any number of local fontdescriptors 204. For instance, the font similarity module 120 cangenerate ranked local font descriptors 206 to include n local fontdescriptors 204, where n represents any integer.

A top-ranked local font descriptor may be automatically selected by thefont synthesis module 122, may be selected by a user of the computingdevice implementing the font modification system, or combinationsthereof as the local font 202 to be used in generating the synthesizedfont 208. By selecting a local font 202 that is visually similar to thesource font 108, the font modification system 104 reduces a number ofglyph modifications to be performed in generating the synthesized font208 in a manner that maintains a consistent appearance with an originaldesign layout for the electronic document. Before considering variousmodifications that may be applied to a local font 202 to generate thesynthesized font 208, consider an example of a glyph outline that may bemodified to generate the synthesized font 208.

FIG. 6 illustrates an example implementation 600 of a glyph outline fora font, as represented by various segments and associated directions.The illustrated example includes a glyph 602 and a representation 604 ofthe glyph 602 as segments having directions. In accordance with one ormore implementations, the representation 604 is a closed Bezier path ofan outline, denoted as points P1-P12. In some implementations, pointsP1-P12 may be expressed as:P=[x,y]where: P represents each point; x is an x-coordinate of the point; and yis a y-coordinate of the point.

In another implementation, the glyph 602 can be represented by one ormore segments as:S=[p0,p1]where: S represents each segment; p0 is a starting point of the segment;and p1 is an endpoint of the segment. Additionally, each segment may bea line segment or a curve segment so for each S if p0 and p1 areconnected by a line, then S is a line segment; and if p0 and p1 areconnected by a curve, then S is a curve segment.

In another implementation, a direction of each segment may be expressedas:Up: [p0.y<p1.y and p0.x==p1.x]Down: [p0.y>p1.y and p0.x==p1.x]Left: [p0.x>p1.x and p0.y==p1.y]Right: [p0.x<p1.x and p0.y==p1.y]LeftUp: [p0.x>p1.x and p0.y<p1.y]RightUp: [p0.x<p1.x and p0.y<p1.y]LeftDown: [p0.x>p1.x and p0.y>p1.y]RightDown: [p0.x<p1.x and p0.y>p1.y]where: p0.x is the x-coordinate of the start point of the segment; p0.yis the y-coordinate of the start point of the segment; p1.x is thex-coordinate of the endpoint of the segment; and p1.y is they-coordinate of the endpoint of the segment.

In an example, the outline of the glyph 402 can be expressed as segmentswith directions as follows:LineSegment[P1,P2]: DownLineSegment[P2,P3]: RightLineSegment[P3,P4]: UpLineSegment[P4,P5]: LeftLineSegment[P5,P6]: UpLineSegment[P6,P7]: RightLineSegment[P7,P8]: UpLineSegment[P8,P9]: LeftLineSegment[P9,P10]: UpLineSegment[P10,P11]: RightLineSegment[P11,P12]: UpLineSegment[P12,P1]: Left

By representing glyph 602 using the representation 604, the glyphsegments and their directions can be leveraged by the font synthesismodule 122 to modify outlines of various glyphs to generate asynthesized font 116 having a visually similar appearance to source font108. Glyph modifications that may be performed by the font synthesismodule 122 are illustrated and described in further detail below withrespect to FIGS. 7A-23.

Horizontal Weight Modification

FIGS. 7A-7C illustrate example implementations of generating synthesizedfont by modifying horizontal glyph weights. As described herein,modifying horizontal glyph weights refers to changing a thickness ofvertical stems of a glyph. In one example, this may be accomplished byleveraging segment directions and common points of segments such asthose illustrated in the representation 604 of the glyph 602.

In some implementations, the font descriptor 112 for the source font 108may include a horizontal weight font attribute to be used as a targetvalue for modifying a local font 202 to obtain synthesized font 116.Such a horizontal weight attribute may quantify an amount by which tomodify a glyph's horizontal weight, which may be expressed as apercentage of a stroke width of a vertical stem of an unmodified glyph,such that a positive percentage corresponds to an increase in the strokewidth of the vertical stem and a negative percentage corresponds to adecrease in the stroke width of the vertical stem.

A modification value for the vertical stem may be expressed as:

$\begin{matrix}{{delta} = \frac{\begin{matrix}\left\lbrack {\left( {{modified}\mspace{14mu}{stroke}\mspace{14mu}{width}} \right) -} \right. \\\left. \left( {{original}\mspace{14mu}{stroke}\mspace{14mu}{width}} \right) \right\rbrack\end{matrix}}{2}} & \left( {{Eq}.\mspace{14mu} 3} \right)\end{matrix}$where: delta is a value to add to both sides of the vertical stem tomodify the horizontal weight of the vertical stem; original stroke widthis the stroke width of the vertical stem of the unmodified glyph; andmodified stroke width is the stroke width of the vertical stem afterapplying a percentage increase or decrease to the original stroke width.

In some implementations, the font modification system 104 may apply thedelta value to an outline of an unmodified glyph for a local font 202based on directions of segments that constitute the outline of theunmodified glyph. For instance, the font synthesis module 122 may applythe delta value to coordinates of points of segments representing aglyph outline based on directions of glyph segments connected to thepoints. As illustrated in FIG. 6, each of the points P1-P12 belongs toat least two segments, and the font synthesis module 122 can apply thedelta value to coordinates of the points P1-P12 based on directions ofthe segments having the points P1-P12. Because each of the points P1-P12in the illustrated example of FIG. 6 represents a starting point of afirst segment and an ending point of a second segment, the fontsynthesis module 122 may determine an application of the delta value tothe coordinates of the points P1-P12 based on a current segment and anext segment. In this manner, any particular point of the points P1-P12represents an endpoint of a current segment and a start point of a nextsegment.

For example, the font synthesis module 122 can determine whether acurrent segment's direction is Up, LeftUp, or RightUp. In response todetermining that the current segment's direction is Up, LeftUp, orRightUp, the font synthesis module 122 may determine whether a directionof the next segment is Up, LeftUp, RightUp, Left, or Right. If thecurrent segment's direction is Up, LeftUp, or RightUp, and if the nextsegment's direction is Up, LeftUp, RightUp, Left, or Right, then thefont synthesis module 122 may apply the delta value to a common point ofthe current segment and the next segment by adding the delta value to anx-coordinate of the common point. In other words, if the currentsegment's direction is Up, LeftUp, or RightUp, and if the next segment'sdirection is Up, LeftUp, RightUp, Left, or Right, then the fontsynthesis module 122 may add the delta value to an x-coordinate of apoint which is the endpoint of the current segment and the start pointof the next segment.

In an example implementation, if the current segment's direction is Up,LeftUp, or RightUp, and if the next segment's direction is Down,LeftDown, or RightDown, then the font synthesis module 122 may prevent asegment from overlapping another segment of the segments representingthe outline of an unmodified glyph. For example, in implementationswhere consecutive segments have opposite directions or oppositedirection components, a delta value may be added to a first segment andthe delta value will be subtracted from a second segment, therebyoverlapping the segments. In other words, the effect of the applicationof the delta value can cause the first segment and the second segment toshift in opposing directions, and because the first segment and thesecond segment are consecutive segments, this scenario can createoverlaps or kinks in an outline of a modified glyph. To avoid this, thefont synthesis module 122 can be implemented to use the theorem ofintersecting lines which is also referred to as the intercept theorem toidentify a point at which the first segment and the second segmentintersect. In this manner, the font synthesis module 122 may change ay-coordinate of a common point between the first segment and the secondsegment based on the identified point at which the first segment and thesecond segment intersect to prevent the overlaps or kinks.

In some implementations, the font synthesis module 122 may determinewhether a current segment's direction is Down, LeftDown, or RightDown.Responsive to determining that the current segment's direction is Down,LeftDown, or RightDown, the font synthesis module 122 may determinewhether a direction of a next segment is Down, LeftDown, RightDown,Left, or Right. If the current segment's direction is Down, LeftDown, orRightDown, and if the next segment's direction is Down, LeftDown,RightDown, Left, or Right, then the font synthesis module 122 may applythe delta value to a common point of the current segment and the nextsegment by subtracting the delta value from an x-coordinate of thecommon point.

FIG. 7A illustrates an example implementation 700 of an unmodifiedglyphs 706 for a local font 202 as well as a modified glyph 708, whichhas a reduced horizontal weight relative to the unmodified glyph 706. Inthe illustrated example, a delta value has been added to x-coordinatesof points P1 and P2, which causes the vertical stem of the modifiedglyph 708 to shift along the x-axis by the delta value. The illustratedexample further includes a modified glyph 710 having a changed origin tomaintain a common origin with the unmodified glyph 706.

FIG. 7B illustrates an example implementation 702 of a modified glyph712 that includes segment overlaps 714, which may result from modifyinghorizontal glyph weights to achieve synthesized font 116. To maintaintypographical accuracy, the font synthesis module 122 is configured toremove these overlaps 714 using the theorem of intersecting lines andidentify a point in which the segments of the modified glyph 712intersect. In response to identifying such a point, the font synthesismodule 122 is configured to change y-coordinates of respective glyphpoints to remove the overlaps 714. Removal of the overlaps 714 resultsin the modified glyph without overlaps 716.

FIG. 7C illustrates an example implementation 704 of modified glyphshaving an increased horizontal weight relative to unmodified glyphs of alocal font 202. In the illustrated example, the horizontal weights of afirst original glyph 718 are increased to generate a first modifiedglyph 720, where the shaded area represents the horizontal weight of thefirst original glyph 718 and the solid outline represents the resultinghorizontal weight of the first modified glyph 720. The illustratedexample further includes a second original glyph 722, the horizontalweight of which has been modified to generate the second modified glyph724. The illustrated example further includes a third original glyph 726and a second modified glyph 728, which results from modifying thehorizontal weight of the third original glyph 726. Finally, theillustrated example includes a fourth original glyph 730 and a fourthmodified glyph 732.

In the illustrated example, progressing from left to right, the modifiedglyphs are increasingly shifted relative to their respective originalglyphs due to increased advanced width. Thus, in generating thesynthesized font 116, the font synthesis module 122 is not limited tomodifying each glyph of a local font 202 in a consistent manner. In someimplementations, the font synthesis module 122 is configured to modifyglyphs of a local font 202 on an individual basis. Alternatively oradditionally, the font synthesis module 122 may modify glyphs of a localfont 202 on a per-line basis, such that each line of the source font 108is modified on a separate basis to preserve an original design layout ofthe electronic document 108.

FIG. 8 illustrates various examples 800 of generating synthesized fontusing horizontal weight modifications. The illustrated examples 800include example representation 802, which is representative of glyphs ofa local font 202 having no horizontal weight modifications. Examplerepresentation 804 illustrates glyphs of the local font 202 as modifiedby decreasing horizontal weight font attributes, such as a 20% decreaseof the local font 202's horizontal weight. As a result of the decreasedhorizontal weight, vertical stems of glyphs in the examplerepresentation 804 have a decreased thickness relative to vertical stemsof glyphs of the example representation 802. The illustrated examplefurther includes example representation 806, which illustrates glyphs ofthe example representation 802 as being modified with an increasedhorizontal weight, such as a 25% increase. As a result, vertical stemsof the example representation 806 have an increased thickness relativeto vertical stems of the example representation 802. Having consideredexamples of generating synthesized font by modifying horizontal stems offont glyphs, consider now examples of generating synthesized font bymodifying vertical stems of font glyphs.

Vertical Weight Modifications

FIG. 9 illustrates an example implementation 900 of generatingsynthesized font by modifying vertical weights of font glyphs. In theillustrated example, unmodified glyph 902 represents an unmodified glyphof a local font 202 that is available for use by the computing deviceimplementing the font modification system 104. In an implementationwhere the font synthesis module 122 determines that font attributes ofthe source font 108 indicate different vertical thicknesses of verticalglyph stems relative to glyphs of the local font 202, the font synthesismodule 122 may leverage the font attributes to determine an amount bywhich to modify vertical weights of the local font 202.

In some implementations, the amount by which the local font 202 is to bemodified may be quantified as a percentage of a stroke height of ahorizontal stem of the unmodified glyph 902, such that a that a positivepercentage corresponds to an increase in the stroke height of thehorizontal stem and a negative percentage corresponds to a decrease inthe stroke height of the horizontal stem. A modification value for thehorizontal stem may be expressed as:

$\begin{matrix}{{delta} = \frac{\begin{matrix}\left\lbrack {\left( {{modified}\mspace{14mu}{stroke}\mspace{14mu}{height}} \right) -} \right. \\\left. \left( {{original}\mspace{14mu}{stroke}\mspace{14mu}{height}} \right) \right\rbrack\end{matrix}}{2}} & \left( {{Eq}.\mspace{14mu} 4} \right)\end{matrix}$where: delta is a value to add to the top and bottom of the horizontalstem to modify the vertical weight of the horizontal stem; originalstroke height is the stroke height of the horizontal stem of theunmodified glyph 902; and modified stroke height is the stroke height ofthe horizontal stem after applying a percentage increase or decrease tothe original stroke height.

The font synthesis module 122 may apply the delta value to an outline ofthe unmodified glyph 902 based on directions of segments representingthe outline of the unmodified glyph 902. For instance, the fontsynthesis module 122 may apply the delta value to coordinates of pointsof segments representing the outline of the unmodified glyph 902 basedon directions of the segments connected to the points. As illustrated inFIG. 6, each of the points P1-P12 belongs to at least two segments, andthe font synthesis module 122 can apply the delta value to coordinatesof the points P1-P12 based on directions of the segments having thepoints P1-P12. Since each of the points P1-P12 in this examplerepresents a starting point of a first segment and an ending point of asecond segment, the font synthesis module 122 may determine anapplication of the delta value to the coordinates of the points P1-P12based on a current segment and a next segment.

In this manner, the font synthesis module 122 may apply the delta valueto points of the unmodified glyph 902 to increase or decrease athickness of the glyph's horizontal stems, which may result in amodified glyph having an increased vertical weight 904 or a modifiedglyph having a decreased vertical weight 906. In the illustratedexample, the modified glyph having increased vertical weight 904 hasthicker horizontal stems than the unmodified glyph 902 and the modifiedglyph having decreased vertical weight 906 has thinner horizontal stemsrelative to the unmodified glyph 902.

FIG. 10 illustrates an example implementation 1000 of generatingsynthesized font by modifying the font's vertical weight whileaccounting for a glyph's origin. In some implementations, modifying aglyph's vertical weight results in a change to the glyph's positionrelative to a baseline for the line of font in which the glyph isincluded. For example, increasing a vertical weight of the glyph canincrease the height of the glyph's bounding box whereas decreasing avertical weight of the glyph may decrease the height of the glyph'sbounding box. The illustrated example includes an unmodified glyph 1002which is represented as segments having directions. In order to maintaina baseline and a bounding box height of the unmodified glyph 1002, thefont synthesis module 122 may be implemented to scale the unmodifiedglyph 1002 in a vertical direction by two times the delta value which isillustrated as resulting in a scaled glyph 1004.

In the illustrated example, the scaled glyph 1004 has been downscaled bytwo times the delta value which decreases a height of a bounding box ofthe scaled glyph 1004 relative to the unmodified glyph 1002. In oneexample, downscaling the unmodified glyph 1002 may be performed by thefont synthesis module 122 as part of increasing a vertical weight of theunmodified glyph 1002. In another example, the font synthesis module 122may be implemented to upscale the unmodified glyph 1002 by two times thedelta value as part of decreasing a vertical weight of the unmodifiedglyph 1002.

In the illustrated example, the scaled glyph 1004 is shifted away fromthe baseline at which the origin of unmodified glyph 1002 is located,which may result in synthesized font that has a common vertical weightattribute to a source font but looks visually dissimilar to the sourcefont due to the shift away from the baseline. To maintain visualsimilarity with the source font, the font synthesis module 122 isconfigured to shift the scaled glyph 1004 such that the shifted glyph isdisposed at a certain distance from the baseline. For instance, the fontsynthesis module 122 may shift the scaled glyph 1004 to generate ashifted glyph 1006 that is positioned at a common distance relative toboth the baseline and a maximum height above the baseline (e.g., theupper limit of the bounding box for the unmodified glyph 1002). In thismanner, the font synthesis module is configured to position the shiftedglyph 1006 such that increasing a thickness of horizontal stems of theshifted glyph 1006 by the delta value on the top and bottom of thehorizontal stems will result in the shifted glyph 1006 having a baselineand a maximum height above the baseline in common with the unmodifiedglyph 1002.

By modifying the vertical weights of glyphs in this manner, the fontsynthesis module 122 is configured to maintain an origin and boundingbox associated with the unmodified glyph 1002, thereby ensuring aresulting visual similarity in an example scenario where a local fontwas selected for synthesis based on having attributes indicatingbaseline and bounding box values similar to a source font to beemulated. In a similar manner, the font synthesis module 122 isconfigured to generate synthesized font 116 by decreasing a verticalweight of the unmodified glyph 1002. To do so, the font synthesis module122 may upscale the unmodified glyph 1002 in the vertical direction bytwice the delta value and shift the upscaled glyph by the delta valuesuch that the scaled glyph is disposed at a distance equal to the deltavalue from the height of the unmodified glyph 1002's bounding box. In anexample implementation, the font synthesis module 122 may decrease thevertical weight of a font by adding the delta value to points of thesegments based on segment directions and subtracting the delta valuefrom points of the segments based on the segment directions.

FIG. 11 illustrates an example implementation 1100 of generatingsynthesized font by modifying vertical weight font attributes. Theillustrated example includes example representation 1102, whichillustrates glyphs having no vertical weight modification, such asoriginal glyphs of a local font 202. Example representation 1104illustrates the glyphs of representation 1102 as having decreasedvertical weight, such as a decrease of the vertical weight fontattribute by 20%. In the illustrated example, horizontal stems of glyphsin the example representation 1104 have decreased thickness relative tohorizontal stems of the original glyphs as illustrated in examplerepresentation 1102. Example representation 1106 illustrates theoriginal glyphs of example representation 1102 as having increasedvertical weight, such as an increase of the vertical weight fontattribute by 30%. Thus, the font synthesis module 122 is configured tomodify vertical weight attributes in generating synthesized font 116.Having considered example implementations of generating synthesized fontby modifying vertical weight attributes, consider now examples ofgenerating synthesized font by modifying overall font weight.

Overall Weight Modification

FIG. 12 illustrates an example implementation 1200 of generatingsynthesized font using overall font weight modifications. Byrepresenting a font glyph as segments having directions as indicated inFIG. 6, the font synthesis module 122 is configured to modify a glyph'shorizontal weight and vertical weight simultaneously. For instance, thefont synthesis module 122 can modify a glyph's overall weight byincreasing or decreasing the glyph's horizontal weight and also byincreasing or decreasing the glyph's vertical weight. The illustratedexample of FIG. 12 includes a representation 1202, which exemplifiesglyphs of a local font 202 prior to modification by the font synthesismodule 122. Representation 1204 illustrates the glyphs of representation1202 as having a decreased overall weight, such as a 20% reduction in afont attribute indicating overall glyph weight. Such a reduction inoverall weight may correspond to equal parts reduction in both thehorizontal and vertical weights for the font. For instance,representation 1204 illustrates the glyphs of representation 1202 ashaving a 20% reduction in vertical weight as well as a 20% reduction inhorizontal weight,

In a similar manner, representation 1206 illustrates the glyphs ofrepresentation 1202 as having an increased overall weight, such as a 20%increase in overall glyph weight. Thus, representation 1206 illustratesthe glyphs of representation 10202 as being increased in both horizontaland vertical weights by 20%, respectively. Although overall weightmodification has been described with respect to equal modifications ofhorizontal weights and vertical weights, the font synthesis module 122is configured to modify overall glyph weight in a manner that does notmodify horizontal and vertical weights equally. For instance, the fontsynthesis module 122 may increase a vertical weight by 20% whileincreasing a horizontal weight by 10%. In this manner, overall weightmodifications may refer to the altering of horizontal weights by m % andvertical weights by n %, where m and n refer to any value betweennegative one hundred and one hundred, inclusive. Having consideredexample implementations of generating synthesized font by modifyingoverall font weight, consider now examples of generating synthesizedfont by modifying font width attributes.

Width Attribute Modification

FIG. 13 illustrates an example implementation 1300 of generatingsynthesized font by modifying font width attributes. The illustratedexample includes a fake width modification 1302 and a true widthmodification 1304 of an unmodified glyph 1306 of a local font. In thefake width modification 1302, when the unmodified glyph 1306 is scaledhorizontally (e.g., increased in width or decreased in width), athickness of the unmodified glyph 1306's vertical stems increases ordecreases accordingly. This increase or decrease in vertical stemthickness is illustrated by a fake condensed modification 1308 and afake extended modification 1310 of the unmodified glyph 1306.

To avoid this increase or decrease in vertical stem thickness, whichresults in a typographically incorrect appearance of a resultingmodified glyph, the font synthesis module 122 is configured to modify ahorizontal weight of the unmodified glyph 1306 while preserving verticalstem thicknesses. Such a preservation is illustrated in the true widthmodification 1304, where the true extended modification 1314 and thetrue extended condensed modification 1312 maintains a vertical stemthickness of the unmodified glyph 1306.

FIG. 14 illustrates an example implementation 1400 of generatingsynthesized font by modifying font width attributes. In the illustratedexample, a false width modification 1402 and true width modification1404 are depicted, which each represent modifications of an unmodifiedglyphs 1406. Specifically, the false width modification 1402 illustratesa false extended modification 1408 and a false condensed modification1410 of the unmodified glyphs 1406. Similarly, the true widthmodification 1404 illustrates a true extended modification 1412 and atrue condensed modification 1414 of the unmodified glyphs 1406.Contrasted with the false width modification 1402, the true withmodification 1404 preserves vertical stem thicknesses of unmodifiedglyphs 1406. In this manner, the font synthesis module 122 is configuredto generate synthesized font 116 through false width modifications, truewidth modifications, and combinations thereof. Having considered exampleimplementations of generating synthesized font by modifying font widthattributes, consider now examples of generating synthesized font bymodifying font CapHeight attributes.

CapHeight Attribute Modifications

FIG. 15 illustrates an example implementation 1500 of generatingsynthesized font by modifying CapHeight font attributes. In theillustrated example, an unmodified glyph 1502 can be modified by thefont synthesis module 122 to alter an appearance of one or more glyphsof a local font 202. For instance, the font synthesis module 122 maygenerate small-cap glyphs as well as high-cap glyphs by modifying aCapHeight font attribute of the unmodified glyph 1502. To do so, thefont synthesis module 122 may scale the unmodified glyph 1502 in avertical direction, which similarity scales a thickness of horizontalglyph stems. To maintain typographical accuracy during suchmodifications, the font synthesis module 122 is configured to maintain athickness of the horizontal glyph stems by modifying a vertical weightof the scaled glyph to increase or decrease the thickness of thehorizontal glyph stems resulting from the vertical scaling.

The font synthesis module 122 is configured to generate a small-capglyph 1504 by modifying a CapHeight attribute of the unmodified glyph1502 to downscale the unmodified glyph 1502 in a vertical directionwhile increasing a vertical weight of the downscaled glyph to preservehorizontal glyph stem thicknesses. In this manner, the font synthesismodule 122 may decrease a height of the unmodified glyph 1502 whilemaintaining a visual appearance of the original unmodified glyph 1502 bypreserving a thickness of horizontal glyph stems. Similarly, the fontsynthesis module 122 is configured to generate a high-cap glyph 1506 byupscaling the unmodified glyph 1502 in a vertical direction anddecreasing a vertical weight of the upscaled glyph, thereby preservingthickness of the unmodified glyph 1502's horizontal glyph stems whiledecreasing a vertical height of the glyph relative to the baseline.

FIG. 16 illustrates an example implementation 1600 of generatingsynthesized font by modifying CapHeight font attributes. The illustratedexample includes representation 1602, which includes small-cap glyphs(right) generated from corresponding unmodified glyphs (left). In asimilar manner, the illustrated example includes representation 1604,which includes small-cap glyphs (right) generated from unmodified glyphs(left). Representation 1606 illustrates small-cap glyphs generated fromunmodified glyphs as well as a glyph 1608 that is representative of alower-case glyph for an unmodified font to illustrate how CapHeight fontattributes can be adjusted such that capital glyphs can be modified tohave a lower height relative to a baseline than a lower-case glyph.Having considered example implementations of generating synthesized fontby modifying font CapHeight attributes, consider now examples ofgenerating synthesized font by modifying font xHeight attributes.

xHeight Attribute Modifications

FIG. 17 illustrates an example implementation 1700 of generatingsynthesized font by modifying glyph xHeight attributes in accordancewith one or more implementations. Because xHeight attributes define adistance between a baseline and a mean line of a lowercase letter in atypeface (e.g., the height of the lowercase letter “x” in a typeface),xHeight is a significant feature of typeface identification andreadability. For instance, fonts having a large xHeight relative to atotal height of the font have relatively shorter ascenders anddescenders and less white space between lines of glyphs.

The font synthesis module 122 is configured to identify the xHeight of afont from font attributes, such as font attributes described by the fontdescriptor 112 of a source font 108 or the font descriptor 204 of alocal font 202. In some implementations, the font synthesis module 122is configured to identify font attributes for an Open Type font based onthe font's OS/2 table. Once the xHeight is identified, the fontsynthesis module 122 may be implemented to scale points between thexHeight and a baseline and the font synthesis module 122 can apply avertical weight delta value to modify the horizontal bars to compensatefor scaling the points.

In some implementations, the font synthesis module 122 modifies aglyph's xHeight by modifying points disposed between the identifiedxHeight and a baseline. For each such point, this modification may beexpressed as:

${xheightFactor} = \frac{\left( {{requested}\mspace{14mu}{xheight}} \right)}{({xheight})}$DeltaY = P.y − baseline pModified.y = baseline + xheightFactor * DeltaYwhere: xheightFactor represents a scaling amount; P.y is a y-coordinateof the point; baseline is the baseline of a glyph; DeltaY is thedistance from the baseline of the glyph; and pModified.y is a modifiedy-coordinate of the point. In an example where a font is italic with an‘angle,’ the modification can be further expressed as:

${p.{Modified}.x} = {{P.x} + \frac{\left( {{{pModified}.y} - {P.y}} \right)}{\tan({angle})}}$where: P.y is a y-coordinate of the point; pModified.y is a modifiedy-coordinate of the point; angle is the angle of the italic font; P.x isan x-coordinate of the point; and p.Modified.x is a modifiedx-coordinate of the point.

Continuing this example, the font synthesis module 122 can beimplemented to apply the vertical weight delta value to compensate forthe decrease in thickness of horizontal bars of the glyph. Afterapplying the vertical weight delta value, the glyph modification module110 can output modified points and generate xHeight modification whichcan be expressed as:P.x=pModified.xP.y=pModified.ywhere: P.x is the modified x-coordinate of the point; and P.y is themodified y-coordinate of the point.

As shown in FIG. 17, an input glyph set 1702 having a requested xHeight1704 as well as a first unmodified glyph set 1706 having a first xHeightand a second unmodified glyph set 1708 having a second xHeight. In oneor more implementations, the font synthesis module 122 is configured togenerate a first modified glyph set 1710 having the requested xHeight1704 by modifying the first unmodified glyph set 1706 and a secondmodified glyph set 1712 also having the requested xHeight 1704 bymodifying the second unmodified glyph set 1708.

FIG. 18 illustrates an example implementation 1800 of generatingsynthesized font by modifying one or more xHeight attributes of a localfont 202. In the illustrated example, representation 1802 depicts alowered xHeight attribute for a font, with an unmodified glyph 1804included for reference. Representation 1806 illustrates a differentexample of a lowered xHeight attribute for a font, contrasted against anunmodified glyph 1808. Representation 1810 depicts an example scenariowhere different xHeight modifications can be applied to different glyphsof a local font 202 to generate a synthesized font 116. Havingconsidered example implementations of generating synthesized font bymodifying font xHeight attributes, consider now examples of generatingsynthesized font by modifying font ascent attributes.

Ascent Attribute Modifications

FIG. 19 illustrates an example implementation 1900 of generatingsynthesized font by modifying glyph ascent attributes in accordance withone or more implementations. As described above, an ascent attributerefers to a maximum height above a baseline to which glyphs of a fontmay extend. In the illustrated example, glyph 1902 is illustrated asascending above a baseline to an ascent line 1904. Glyphs 1906 and 1908are illustrative of examples in which the font synthesis module 122adjusts font ascent attributes differently, such that glyphs 1906 and1908 extend from the baseline beyond the ascent line 1904 with differentmagnitudes. Having considered example implementations of generatingsynthesized font by modifying font ascent attributes, consider nowexamples of generating synthesized font by modifying font descentattributes.

Descent Attribute Modifications

FIG. 20 illustrates an example implementation 2000 of generatingsynthesized font by modifying glyph descent attributes in accordancewith one or more implementations. As described above, a descentattribute refers to a maximum depth below a baseline to which glyphs ofa font may extend. In the illustrated example, glyph 2002 is illustratedas descending below a baseline (not illustrated) to a descent line 2004,while glyphs 2006 are illustrated as not descending below the baseline.To compensate for a resulting scaling of glyphs having modified descentattributes, the font synthesis module 122 is configured to adjustvertical weight attributes to modified glyphs, thereby maintainingtypographical accuracy when generating the synthesized font 116. Havingconsidered example implementations of generating synthesized font bymodifying font descent attributes, consider now examples of generatingsynthesized font by generating new composite glyphs.

Composite Glyph Generation

FIG. 21 illustrates an example implementation 2100 of generatingsynthesized font by generating composite glyphs. In the illustratedexample, a first glyph 2102, a second glyph 2104, and a third glyph 2106are oriented such that the glyphs 2102, 2104, and 2106 are alignedhorizontally in line with one another. The font synthesis module 122 isconfigured to modify the glyphs 2102, 2104, and 2106 by scaling theglyphs and modifying one or more of a horizontal or vertical weight forindividual ones of the glyphs 2102, 2104, and 2106, which may result ina first modified glyph 2108, a second modified glyph 2110, and a thirdmodified glyph 2112. In the illustrated example, the glyphs 2108, 2110,and 2112 correspond to the glyphs 2102, 2104, and 2106, respectively,and have been modified such that the glyphs are oriented diagonallyrelative to one another.

In accordance with one or more implementations, a fourth glyph 2114, afifth glyph 2116, and a sixth glyph 2118 are oriented as representing amathematical relationship between glyphs of the font. To generatesynthesized font 116 that corresponds to a mathematical relationshipotherwise represented by source font 108, the font synthesis module 122is configured to scale the fourth glyph 2114 and the sixth glyph 2118and modified one or more of their respective horizontal and verticalweights to generate a fourth modified glyph 2120 and a sixth modifiedglyph 2122, such that the fifth glyph 2116 has been removed in order forthe fourth modified glyph 2120 and the sixth modified glyph 2122 toillustrate the same mathematical relationship in a manner that isvisually similar to the source font 108 being emulated by thesynthesized font 116. Having considered example implementations ofgenerating synthesized font by generating new composite glyphs, considernow examples of generating synthesized font by modifying fontItalicAngle attributes.

ItalicAngle Attribute Modifications

FIG. 22 illustrates an example implementation 2200 of generatingsynthesized font by modifying font ItalicAngle attributes. A font'sItalicAngle attributes refer to an angle, expressed in degreescounterclockwise from a vertical axis, of dominant vertical strokes of afont. As described herein, a font's slant angle may be modified underboth oblique and italic transformations, and combinations thereof. Inthe illustrated example, representation 2202 includes glyphs of a fontwithout a modified slant angle, while representation 2204 includes theglyphs as having a modified ItalicAngle attribute. Having consideredexample implementations of generating synthesized font by modifying fontItalicAngle attributes, consider now examples of generating synthesizedfont by modifying font contrast attributes.

Contrast Attribute Modifications

FIG. 23 illustrates an example implementation 2300 of generatingsynthesized font by modifying font contrast attributes. In someimplementations, such a modification of contrast attributes may beachieved via the font synthesis module 122 modifying respective verticaland/or horizontal weights of a font glyph, such as modifying respectiveweights of the glyph 2302. For instance, the font synthesis module 122may generate glyphs having increased contrast (illustrated from left toright), where glyphs 2304, 2306, 2308, and 2310 represent instances ofthe glyph 2302 having progressively increased font contrast attributes.

The font synthesis module 122 is configured to generate synthesized font116 using any one or combination of the above-referenced font attributemodifications, such that a local font 202 can be effectively modified tohave a visually similar appearance to a source font 108, therebyenabling the computing device 102 to maintain an original design layoutof the electronic document 106 in scenarios where the computing device102 is not authorized to use the source font 108.

Having considered example implementations of generating synthesizedfont, consider now an example user interface useable to generatesynthesized font.

Example User Interface

FIG. 24 illustrates an example implementation 2400 of a user interfacefor the font modification system 104 that may be used to facilitategeneration of synthesized font 116 using the techniques describedherein. The illustrated example depicts interface 2402, which includes acontrol 2404 configured to receive user input specifying font attributesto be transferred from a source font 2406 to a target font 2408. In theillustrated example, the control is depicted as including selectableboxes for a plurality of different font attributes, where verticalweight and width attributes of the source font 2406 are selected to beused as target values for modifying the respective vertical weight andwidth attributes of the target font 2408. In this manner, the fontmodification system 104 provides a user interface that enables a user tomanually specify various font attributes of a source font 108 to beapplied to a local font 202 in generating the synthesized font 116.

The illustrated interface 2402 is further configured to display apreview of the target font 2408 as modified by the selected attributesin the control 2404. Although control 2404 is illustrated as includingselectable boxes, control 2404 may be configured in a variety ofmanners. For instance, instead of selectable boxes, each font attributemay be associated with an adjustable indicator (e.g., a slide bar, ascroll wheel, etc.) where a low end of the adjustable indicator for afont attribute corresponds to the font attribute value for the targetfont 2408 and a high end of the adjustable indicator corresponds to thefont attribute value for the source font 2406. In this manner, a user ofthe font modification system 104 can fine-tune how synthesized font 116is generated from a local font 202, using font attributes of a sourcefont 108.

Having considered example details of generating synthesized font,consider now some example procedures to illustrate aspects of thetechniques.

Example Procedures

The following discussion describes techniques that may be implementedutilizing the previously described systems and devices. Aspects of eachof the procedures may be implemented in hardware, firmware, software, ora combination thereof. The procedures are shown as a set of blocks thatspecify operations performed by one or more devices and are notnecessarily limited to the orders shown for performing the operations bythe respective blocks. In portions of the following discussion,reference may be made to FIGS. 1-24.

FIG. 25 depicts a procedure 2500 in an example implementation ofgenerating a synthesized font using the techniques described herein. Anelectronic document that includes text formatted according to a sourcefont is received at a computing device (block 2502). The computingdevice 102 implementing the font modification system 104, for instance,receives electronic document 106 including source font 108 defined byfont descriptor 112 from the different computing device 114.

A determination is made as to whether the computing device is authorizedto use the source font (block 2504). In response to determining that thecomputing device is authorized to use the source font, the computingdevice renders the electronic document with the source font (block2506). Alternatively, in response to determining that the computingdevice is not authorized to use the source font, at least one visuallysimilar font that the computing device is authorized to use isidentified (block 2508). The font similarity module 120, for instance,identifies at least one local font 202 that is available for use by thecomputing device 102 by comparing the font descriptor 112 for the sourcefont 108 against respective local font descriptors 204, such as localfont descriptors generated by the local font descriptor module 118. Insome implementations, the font similarity module 120 is configured toselect a single local font 202 that is most visually similar to thesource font 108.

The visually similar font is then synthesized to preserve an originaldesign layout for the electronic document (block 2510). The fontsynthesis module 122, for instance, leverages information included inthe font descriptor 112 for the source font 108 and the local fontdescriptor 204 for the most visually similar local font 202 to identifyan array of design vectors that are to be applied to the local font 202to achieve a visually similar appearance to the source font 108. Afterdetermining the array of design vectors, the font synthesis module 122applies the array of design vectors to one or more glyph outlines of thelocal font 202 to generate synthesized font 206. The synthesized font206 can then be output by the rendering module 124 as synthesized font116. In some implementations, the synthesized font 116 is output as apreview display for acceptance by a user of the computing deviceimplementing the font modification system 104 prior to replacement ofthe source font.

The source font is then replaced with the synthesized font in theelectronic document (block 2512). The electronic document with thesynthesized font is then rendered (block 2514). The rendering module124, for instance, may output the electronic document 106 with thesynthesized font 116 in place of the source font 108, such that theelectronic document 106 is rendered at the computing device 102 usingonly fonts that the computing device 102 is authorized to use, whilepreserving an original design layout of the electronic document 106.

FIG. 26 depicts a procedure 2600 in an example implementation ofgenerating synthesized font using the techniques described herein. Inputspecifying a source font from which font attributes are to be applied toa target font is received (block 2602). The font modification system104, for instance, may receive input specifying a source font 108 fromwhich one or more font attributes 318, as specified by the source font108's font descriptor 112, are to be applied to a target font. Input isthen received specifying the target font (block 2604). The fontmodification system 104, for instance, may receive input specifying alocal font 202 to be modified using the one or more font attributes 318.

A list of selectable font attributes useable for modifying the targetfont are then displayed (block 2606). The rendering module 124, forinstance, may output interface 2402 together with a control 2404 thatlists the one or more font attributes 318 of the source font 108 to beused as values for modifying the local font 202. Input is then receivedselecting at least one of the selectable font attributes (block 2608).The font modification system 104, for instance, may receive anindication of input selecting certain font attributes for the sourcefont 108 to be used as target metrics for modifying corresponding fontattributes of the local font 202.

A preview of the target font as modified using the selected fontattributes is then displayed (block 2610). The rendering module 124, forinstance, outputs a display of the target font 2408 as modified by thefont attributes selected in control 2404. A modified version of thetarget font can then be output (block 2612). The rendering module 124,for instance, may output the synthesized font 116 in response toreceiving input at control 2404 accepting the modifications to thetarget font 2408 as modified using the one or more font attributes 318of the source font 2406.

Having described example procedures in accordance with one or moreimplementations, consider now an example system and device that can beutilized to implement the various techniques described herein.

Example System and Device

FIG. 27 illustrates an example system generally at 2700 that includes anexample computing device 2702 that is representative of one or morecomputing systems and/or devices that may implement the varioustechniques described herein. This is illustrated through inclusion ofthe font modification system 104. The computing device 2702 may be, forexample, a server of a service provider, a device associated with aclient (e.g., a client device), an on-chip system, and/or any othersuitable computing device or computing system.

The example computing device 2702 as illustrated includes a processingsystem 2704, one or more computer-readable media 2706, and one or moreI/O interface 2708 that are communicatively coupled, one to another.Although not shown, the computing device 2702 may further include asystem bus or other data and command transfer system that couples thevarious components, one to another. A system bus can include any one orcombination of different bus structures, such as a memory bus or memorycontroller, a peripheral bus, a universal serial bus, and/or a processoror local bus that utilizes any of a variety of bus architectures. Avariety of other examples are also contemplated, such as control anddata lines.

The processing system 2704 is representative of functionality to performone or more operations using hardware. Accordingly, the processingsystem 2704 is illustrated as including hardware elements 2710 that maybe configured as processors, functional blocks, and so forth. This mayinclude implementation in hardware as an application specific integratedcircuit or other logic device formed using one or more semiconductors.The hardware elements 2710 are not limited by the materials from whichthey are formed or the processing mechanisms employed therein. Forexample, processors may be comprised of semiconductor(s) and/ortransistors (e.g., electronic integrated circuits (ICs)). In such acontext, processor-executable instructions may beelectronically-executable instructions.

The computer-readable storage media 2706 is illustrated as includingmemory/storage 2712. The memory/storage 2712 represents memory/storagecapacity associated with one or more computer-readable media. Thememory/storage component 2712 may include volatile media (such as randomaccess memory (RAM)) and/or nonvolatile media (such as read only memory(ROM), Flash memory, optical disks, magnetic disks, and so forth). Thememory/storage component 2712 may include fixed media (e.g., RAM, ROM, afixed hard drive, and so on) as well as removable media (e.g., Flashmemory, a removable hard drive, an optical disc, and so forth). Thecomputer-readable media 2706 may be configured in a variety of otherways as further described below.

Input/output interface(s) 2708 are representative of functionality toallow a user to enter commands and information to computing device 2702,and also allow information to be presented to the user and/or othercomponents or devices using various input/output devices. Examples ofinput devices include a keyboard, a cursor control device (e.g., amouse), a microphone, a scanner, touch functionality (e.g., capacitiveor other sensors that are configured to detect physical touch), a camera(e.g., which may employ visible or non-visible wavelengths such asinfrared frequencies to recognize movement as gestures that do notinvolve touch), and so forth. Examples of output devices include adisplay device (e.g., a monitor or projector), speakers, a printer, anetwork card, tactile-response device, and so forth. Thus, the computingdevice 2702 may be configured in a variety of ways as further describedbelow to support user interaction.

Various techniques may be described herein in the general context ofsoftware, hardware elements, or program modules. Generally, such modulesinclude routines, programs, objects, elements, components, datastructures, and so forth that perform particular tasks or implementparticular abstract data types. The terms “module,” “functionality,” and“component” as used herein generally represent software, firmware,hardware, or a combination thereof. The features of the techniquesdescribed herein are platform-independent, meaning that the techniquesmay be implemented on a variety of commercial computing platforms havinga variety of processors.

An implementation of the described modules and techniques may be storedon or transmitted across some form of computer-readable media. Thecomputer-readable media may include a variety of media that may beaccessed by the computing device 2702. By way of example, and notlimitation, computer-readable media may include “computer-readablestorage media” and “computer-readable signal media.”

“Computer-readable storage media” may refer to media and/or devices thatenable persistent and/or non-transitory storage of information incontrast to mere signal transmission, carrier waves, or signals per se.Thus, computer-readable storage media refers to non-signal bearingmedia. The computer-readable storage media includes hardware such asvolatile and non-volatile, removable and non-removable media and/orstorage devices implemented in a method or technology suitable forstorage of information such as computer readable instructions, datastructures, program modules, logic elements/circuits, or other data.Examples of computer-readable storage media may include, but are notlimited to, RAM, ROM, EEPROM, flash memory or other memory technology,CD-ROM, digital versatile disks (DVD) or other optical storage, harddisks, magnetic cassettes, magnetic tape, magnetic disk storage or othermagnetic storage devices, or other storage device, tangible media, orarticle of manufacture suitable to store the desired information andwhich may be accessed by a computer.

“Computer-readable signal media” may refer to a signal-bearing mediumthat is configured to transmit instructions to the hardware of thecomputing device 2702, such as via a network. Signal media typically mayembody computer readable instructions, data structures, program modules,or other data in a modulated data signal, such as carrier waves, datasignals, or other transport mechanism. Signal media also include anyinformation delivery media. The term “modulated data signal” means asignal that has one or more of its characteristics set or changed insuch a manner as to encode information in the signal. By way of example,and not limitation, communication media include wired media such as awired network or direct-wired connection, and wireless media such asacoustic, RF, infrared, and other wireless media.

As previously described, hardware elements 2710 and computer-readablemedia 2706 are representative of modules, programmable device logicand/or fixed device logic implemented in a hardware form that may beemployed in some embodiments to implement at least some aspects of thetechniques described herein, such as to perform one or moreinstructions. Hardware may include components of an integrated circuitor on-chip system, an application-specific integrated circuit (ASIC), afield-programmable gate array (FPGA), a complex programmable logicdevice (CPLD), and other implementations in silicon or other hardware.In this context, hardware may operate as a processing device thatperforms program tasks defined by instructions and/or logic embodied bythe hardware as well as a hardware utilized to store instructions forexecution, e.g., the computer-readable storage media describedpreviously.

Combinations of the foregoing may also be employed to implement varioustechniques described herein. Accordingly, software, hardware, orexecutable modules may be implemented as one or more instructions and/orlogic embodied on some form of computer-readable storage media and/or byone or more hardware elements 2710. The computing device 2702 may beconfigured to implement particular instructions and/or functionscorresponding to the software and/or hardware modules. Accordingly,implementation of a module that is executable by the computing device2702 as software may be achieved at least partially in hardware, e.g.,through use of computer-readable storage media and/or hardware elements2710 of the processing system 2704. The instructions and/or functionsmay be executable/operable by one or more articles of manufacture (forexample, one or more computing devices 2702 and/or processing systems2704) to implement techniques, modules, and examples described herein.

The techniques described herein may be supported by variousconfigurations of the computing device 2702 and are not limited to thespecific examples of the techniques described herein. This functionalitymay also be implemented all or in part through use of a distributedsystem, such as over a “cloud” 2714 via a platform 2716 as describedbelow.

The cloud 2714 includes and/or is representative of a platform 2716 forresources 2718. The platform 2716 abstracts underlying functionality ofhardware (e.g., servers) and software resources of the cloud 2714. Theresources 2718 may include applications and/or data that can be utilizedwhile computer processing is executed on servers that are remote fromthe computing device 2702. Resources 2718 can also include servicesprovided over the Internet and/or through a subscriber network, such asa cellular or Wi-Fi network.

The platform 2716 may abstract resources and functions to connect thecomputing device 2702 with other computing devices. The platform 2716may also serve to abstract scaling of resources to provide acorresponding level of scale to encountered demand for the resources2718 that are implemented via the platform 2716. Accordingly, in aninterconnected device embodiment, implementation of functionalitydescribed herein may be distributed throughout the system 2700. Forexample, the functionality may be implemented in part on the computingdevice 2702 as well as via the platform 2716 that abstracts thefunctionality of the cloud 2714.

CONCLUSION

Although the invention has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or acts described. Rather, the specificfeatures and acts are disclosed as example forms of implementing theclaimed invention.

What is claimed is:
 1. In a digital medium environment to synthesize alocal font to have a visually similar appearance to a source font in anelectronic document, a method implemented by a computing device, themethod comprising: receiving, by the computing device, the electronicdocument including the source font from a different computing device;extracting, by the computing device, a font descriptor for the sourcefont from the electronic document, the font descriptor includinginformation describing a plurality of font attributes for the sourcefont; identifying, by the computing device, the local font as beingvisually similar to the source font by comparing the font descriptor forthe source font to a local font descriptor for the local font;automatically modifying, by the computing device, an outline of at leastone glyph of the local font to have a visual appearance that is similarto a corresponding glyph of the source font using at least one fontattribute value specified in the font descriptor for the source font;generating, by the computing device, synthesized font using the modifiedoutline of the at least one glyph of the local font; and outputting, bythe computing device, the electronic document with the synthesized fontin place of the source font.
 2. The method as described in claim 1,wherein the font descriptor for the source font is not reversible by thecomputing device to render the source font.
 3. The method as describedin claim 1, further comprising rendering a visual appearance of thelocal font that includes multiple glyphs of the local font and derivingthe local font descriptor from the visual appearance of the local fontusing a font visual similarity model trained with machine learning. 4.The method as described in claim 1, wherein identifying the local fontas being visually similar to the source font comprises comparing, for aplurality of different local fonts, a local font descriptor for thelocal font to the font descriptor for the source font and generating aranked list of visually similar font descriptors.
 5. The method asdescribed in claim 1, wherein modifying the outline of the at least oneglyph of the local font does not modify an original font-program for thelocal font and is performed at run-time by performing the modifying inmemory of the computing device.
 6. The method as described in claim 1,wherein comparing the font descriptor for the source font to the localfont descriptor for the local font comprises comparing the plurality offont attributes for the source font to a plurality of font attributesfor the local font and computing a design vector array describingdifferences between the plurality of font attributes for the source fontand the plurality of font attributes for the local font.
 7. The methodas described in claim 1, wherein identifying the local font as beingvisually similar to the source font is further performed in response tocausing display of a collection of local fonts and receiving user inputselecting the local font from the collection of local fonts.
 8. Themethod as described in claim 1, wherein modifying the outline of the atleast one glyph of the local font comprises adjusting a horizontalthickness of one or more vertical stems of the at least one glyph. 9.The method as described in claim 1, wherein modifying the outline of theat least one glyph of the local font comprises adjusting a verticalthickness of one or more horizontal stems of the at least one glyph. 10.The method as described in claim 1, wherein modifying the outline of theat least one glyph of the local font comprises adjusting a height of theat least one glyph relative to a baseline for the local font.
 11. Themethod as described in claim 1, wherein modifying the outline of the atleast one glyph of the local font comprises adjusting a depth below abaseline for the local font to which the outline of the at least oneglyph extends.
 12. The method as described in claim 1, wherein modifyingthe outline of the at least one glyph of the local font comprisesadjusting an angle relative to a vertical axis of one or more verticalstrokes of the at least one glyph.
 13. The method as described in claim1, wherein modifying the outline of the at least one glyph of the localfont comprises adjusting a width of the at least one glyph.
 14. Themethod as described in claim 1, wherein modifying the outline of the atleast one glyph of the local font comprises maintaining an origin of theat least one modified glyph.
 15. The method as described in claim 1,wherein modifying the outline of the at least one glyph of the localfont comprises preventing overlap of segments of the at least one glyphthat have a point in common and are oriented in opposite directions bychanging coordinates of the point in common.
 16. In a digital mediumenvironment to synthesize a local font to have a visually similarappearance to a source font in an electronic document, a computingdevice comprising: one or more processors; and a computer-readablestorage medium having instructions stored thereon that are executable bythe one or more processors to perform operations comprising: receiving,by the computing device, the electronic document including the sourcefont from a different computing device; extracting, by the computingdevice, a font descriptor for the source font from the electronicdocument, the font descriptor including information describing aplurality of font attributes for the source font; identifying, by thecomputing device, the local font as being visually similar to the sourcefont by comparing the font descriptor for the source font to a localfont descriptor for the local font; automatically modifying, by thecomputing device, an outline of at least one glyph of the local font tohave a visual appearance that is similar to a corresponding glyph of thesource font using at least one font attribute value specified in thefont descriptor for the source font; generating, by the computingdevice, synthesized font using the modified outline of the at least oneglyph of the local font; and outputting, by the computing device, theelectronic document with the synthesized font in place of the sourcefont.
 17. The computing device as described in claim 16, whereinmodifying the outline of the at least one glyph of the local fontcomprises adjusting an angle relative to a vertical axis of one or morevertical strokes of the at least one glyph.
 18. The computing device asdescribed in claim 16, wherein modifying the outline of the at least oneglyph of the local font comprises maintaining an origin of the at leastone modified glyph.
 19. The computing device as described in claim 16,wherein modifying the outline of the at least one glyph of the localfont comprises adjusting a depth below a baseline for the local font towhich the outline of the at least one glyph extends.
 20. In a digitalmedium environment to synthesize a local font to have a visually similarappearance to a source font in an electronic document, acomputer-readable storage medium storing instructions that areexecutable by a computing device to perform operations comprising:receiving the electronic document including the source font from adifferent computing device; extracting a font descriptor for the sourcefont from the electronic document, the font descriptor includinginformation describing a plurality of font attributes for the sourcefont; identifying the local font as being visually similar to the sourcefont by comparing the font descriptor for the source font to a localfont descriptor for the local font; automatically modifying an outlineof at least one glyph of the local font to have a visual appearance thatis similar to a corresponding glyph of the source font using at leastone font attribute value specified in the font descriptor for the sourcefont; generating synthesized font using the modified outline of the atleast one glyph of the local font; and outputting the electronicdocument with the synthesized font in place of the source font.